<!DOCTYPE html>
<html lang="en">
<head>
		{{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
</style>
<body class="common-home res layout-home1">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
	{{template "pc/public/head.html" .}}
  	{{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<div class="myintegral">
					<div class="header">
						<div class="left">
							<dl>我的积分：<span>{{.integral}}</span></dl>
							<dl>
								<!-- <a href="">帮助中心</a> -->
								<a href="/my/integral_list">积分明细</a>
							</dl>
						</div>
						<div class="fr right">
							<img src="{{.system.wpathname}}">
							<p>扫码关注统采微信公众号 分享得积分</p>
						</div>
					</div>
					<div class="box">
						<h1>积分兑好礼</h1>
						<ul>
							{{range .product}}
							<li>
								<!-- <a href=""> -->
									<img src="{{.pathname}}">
									<p class="overpl1">{{.title}}</p>
									<p class="c-999"><span>{{.integral}}</span> 积分</p>
									<button class="get" data-id="{{.id}}">兑换</button>
								<!-- </a> -->
							</li>
							{{end}}
						</ul>
						<div class="tx-c">——  更多商品兑换请去公众号查看  ——</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
</body>
</html>
<script type="text/javascript">
	$('.get').click(function(){
		var id=$(this).attr('data-id');
		wxc.xcConfirm("您确定要兑换吗?","confirm",{onOk:function(){
	      $.ajax({
	        url:window.location.href,
	        data:{id:id},
	        type:'post',
	        success:function(res) {
	          if(res==1){
	            showToast('兑换成功');
	           	history.go(0)
	          }else if(res==0){
	            showToast('网络繁忙,请重试');
	          }else if(res==2){
	            showToast('该物品已售罄');
	          }else if(res==3){
	            showToast('积分不足');
	          }
	        }
	      })  
	    }});
	})
</script>
